/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pa165.pneu.pneuservisbackend.dao;

import java.math.BigDecimal;
import java.util.List;
import pa165.pneu.pneuservisbackend.entiies.Season;
import pa165.pneu.pneuservisbackend.entiies.TyreType;

/**
 *
 * @author Lukas Stevko
 */
public interface TyreTypeDAO {
    /**
     * This function create Tyre object in database
     * @param tyreType object which is desired to be stored in database
     * @throws IllegalArgumentException if tyreType is null or tyreType id is already set
     */
    void createTyreType(TyreType tyreType);
    /**
     * This function is getting Tyre object from database by id 
     * @param id primary key of service order
     * @return object form database
     */
    TyreType getTyreType(Long id);
    /**
     * This method updates Tyre attributes in database  
     * @param tyreType Tyre to be updated 
     * @throws IllegalArgumentException if Tyre id is null or tyre does not exist in database 
     */
    void updateTyreType(TyreType tyreType);
    /**
     * This method remove Tyre from database 
     * @param tyreType tyre to be removed
     * @throws IllegalArgumentException if tyre does not exist in database or tyre Type is null
     */
    void removeTyreType(TyreType tyreType);
    /**
     * This method return all Tyres from database 
     * @return found tyres
     */
    List<TyreType> getAllTyreTypes();
    /**
     * This method return all tyres with certain rim size
     * @param rimSize rim size of Tyre 
     * @return Tyres with selected rim size. Empty collection  is returned if none of tyres does not fit to rim 
     * @throws IllegalArgumentException if rim size is below zero
     */
    List<TyreType> findTyresByRimSize (int rimSize);
   
    /**
     * This metod serch all tyres with selected widthes
     * @param width desired width
     * @return found tyres
     * @throws IllegalArgumentException if width is below zero
     */
    List<TyreType> findTyresByWidth(int width);
    
    /**
     * This method serch tyres from database by its profile 
     * @param profile desired profile
     * @return List of tyres. If none of tyres has this profile empty List is returned.
     * @throws IllegalArgumentException if profile is below zero
     */
    List<TyreType> findTyresByProfile(int profile);
    
    /**
     * This method serch tyres fom database by its season
     * @param season desired season
     * @return List of tyres. If none of tyres has desired season empty List is returned.
     */
    List<TyreType> findTyresBySeason(Season season);
   
    /**
     * This method serach tyres from database 
     * @param price price of tyre
     * @return  List of tyres. If none of tyres has desired price empty List is returned.
     * @throws IllegalArgumentException if price is below zero
     */
    List<TyreType> findTyresByPrice(BigDecimal price);
    
    /**
     * This method serch all tyres with selected manufacturer in database 
     * @param manufacturer manufacturer of tyre
     * @return found tyres
     * @throws IllegalArgumentException if selected manufacturer does not exist
     */
    List<TyreType> findTyresByManufacturer(String manufacturer);
}
